<template>
	<view class="padding30rpx">
		<view v-if="data.length>0">
			<view class="dis u-m-b-20">
				<view></view>
				<view class="hui66 flexc align-items" @tap="BuyParticulars">
					购买明细
					<u-icon style="margin-left: 15rpx;" name="arrow-right" size="28"></u-icon>
					<!-- <image style="width: 15rpx;height: 24rpx; margin-left: 15rpx;" src="../../static/user/right.png"></image> -->
				</view>
			</view>
			<!-- <view class="dis cour"  v-for="(item,index) in data" :key="index">
				<view class="cour-left">
					<image :src="item.curriculumimg"></image>
				</view>
				<view class="cour-right">
					<view class="clamp cour-biao">{{item.curriculumname}}</view>
					<view class="dis  cour-bot" v-if="item.status == 0">
						<view class="cour-btn ">拼团价格：<label>{{item.currencys}}</label></view>
						<view class="cour-ju">正在拼团</view>
					</view>
					<view class="dis  cour-bot" v-if="item.status == 1">
						<view class="cour-btn ">特价购买：<label>{{item.currencys}}</label></view>
					</view>
					<view class="dis  cour-bot">
						<view class="cour-btn ">学习币：<label>{{item.currencys}}</label></view>
					</view>
				</view>
			</view> -->
			<view class="listBox u-flex" v-for="(item,index) in data" :key="index" @click="$mHelper.to('/pages/term/course/course?id='+item.curriculumid+'&pid='+item.pid)">
				<view class="">
					<u-image width="180rpx" height="180rpx" :src="item.curriculumimg"></u-image>
				</view>
				<view class="right_box u-flex-1 ">
					<view class="cname">{{item.curriculumname}}</view>
					<view class="u-flex u-row-between">
						<view class="iconfs">学习币：{{item.currencys}}</view>
						<!-- <view class="status">
							正在拼团
						</view> -->
					</view>
				</view>
			</view>
		</view>
		<view v-if="data.length<1" style="padding-top: 400rpx;" class="u-p-b-100">
			<u-empty icon-size="280" text="暂无数据~" src="/static/images/noneList.png"></u-empty>
		</view>
		<view class="u-padding-20" v-else>
			<u-loadmore :status="status" />
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: [],
				status: 'nomore',
			}
		},
		onLoad() {
			this.selectUserCurriculum()
		},
		methods: {
			selectUserCurriculum() {
				uni.request({
					method: 'GET',
					url: this.$api + '/app/CurrencyController/selectUserCurriculum',
					header: {
						'token': uni.getStorageSync('token')
					},
					success: (res) => {
						console.log(res.data)
						if (res.data.code == 200) {
							this.data = res.data.data
						}
					}
				})
			},
			//购买明细
			BuyParticulars() {
				uni.navigateTo({
					url: '../BuyParticulars/BuyParticulars'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.listBox {
		width: 92%;
		margin-left: 4%;
		margin-bottom: 30rpx;
	}

	.right_box {
		height: 170rpx;
		margin-left: 20rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.cname {
		font-weight: 550;
		font-size: 30rpx;
	}

	.iconfs {
		padding: 5rpx 25rpx;
		background-color: #D9F6FF;
		border-radius: 8px 0px;
		color: #00A29A;
		// display: linb;
	}

	.status {
		font-size: 28rpx;
		color: #FF542C;
		font-weight: 550;
	}

	.cour {
		margin-top: 25rpx;
		position: relative;
		border: 1rpx solid red;

		.cour-left {
			border: 1rpx solid red;
			width: 180rpx;
			height: 180rpx;
			margin-right: 25rpx;

			image {
				width: 180rpx;
				height: 180rpx;
				border-radius: 10rpx;
			}
		}

		.cour-biao {
			font-size: 30rpx;
			color: #333333;
		}

		.cour-bot {
			position: absolute;
			bottom: 0;
			width: 70%;

			.cour-ju {
				color: #FF542C;
				font-size: 28rpx;
				position: absolute;
				right: 0;
			}

			.cour-btn {
				border-top-left-radius: 15rpx;
				border-bottom-right-radius: 15rpx;
				padding: 0 20rpx;
				color: #00A29A;
				height: 48rpx;
				line-height: 48rpx;
				background-color: #D9F6FF;

			}
		}
	}

	.cour-right {
		border: 1rpx solid red;
	}
</style>
